//引入封装好的接口
import { getmenulist } from "../../../request/api"
const state = {
    menulist: []
}
const getters = {
    getMenu(state){
        return state.menulist
    }
}
const mutations = {
    REQ_MENULIST(state,payload){
        state.menulist = payload
    }
}
const actions = {
    getMenuAction({ commit }) {
        getmenulist().then((res) => {
            commit('REQ_MENULIST',res.list)
        })
    }

}

export default {
    state, getters, mutations, actions,
    //命名空间
    namespaced: true
}